WeChat

WeChat is a widely used messaging application. It’s also the only messaging app used by citizens of China.

To make it easy for your consumers to make purchases and get answers to questions using WeChat, the messaging channel they already use every day, DRUID authors can integrate DRUID chatbots with WeChat. This way, customers will be able to start a conversation with your chat bot in WeChat.

Note:  DRUID currently supports only image uploads from WeChat (no image downloads). The supported image formats are .jpg, .jpeg and .png.

This section describes how to integrate your DRUID bot with the WeChat channel.

Prerequisites

  • You built and published a DRUID chatbot.
  • You have an official WeChat account.
  • Contact Druid Tech Support to get the server URL and IP address for WeChat integration.
  • For DRUID on premise deployments, make sure that you provide access to/from the necessary messaging endpoints as follows:
  • Outbound api.weixin.qq.com
    Inbound DRUID.BotApp

This section describes how to integrate your chatbot with WeChat.

Step 1: Configure your WeChat official account

  1. Go to WeChat Official Accounts Platform and log in either by scanning the QR code or by using your WeChat credentials.
  2. On the main menu, scroll down to Development and click Basic Configuration.
  3. In the Server Configuration section, click the Change Configuration button. The server configuration page appears.
  4. In the URL field, enter the server address URL provided to you by Druid Tech Support.
  5. In the Token field, enter a token in English letters or numbers with a length between 3 and 32 characters.
  6. Click the Random Generation button. An EncodingAESKey is generated.
  7. Write down the token and the EncodingAESKey, you will need them to configure the Druid chat bot.
  8. Select Plain Text Mode for message encryption.
  9. Click the Submit button to save the server configuration. The Basic Configuration page appears.
  10. Write-down or copy/paste to a document the Developer ID (AppID) and the Developer Password (AppSecret).

    If you forgot the AppSecret (password), generate a new one by clicking Reset and passing the two-factor authentication:

    1. Scan a QR code on the webpage.
    2. Re-enter your account password.
  11. Once you have completed the security verifications, a new App Secret is generated. Write it down or copy/paste it to a document. Then click the Confirm and Next.
  12. Add the server IP address you received from Druid Tech Support to the IP Whitelist. To do, follow these steps:
    1. Click the View link next to the IP whitelist field. The Check IP Whitelist page appears.
    2. Click Modify. The IP Whitelist Settings page appears.
    3. Enter the IP address you received from Druid Tech Support.
    4. Click Confirm modification to save the changes. The page closes.
  13. On the main menu, scroll-down to Settings and click Account Info. The Account details page appears.
  14. Download the QR code. Once you complete the WeChat integration you will have to make the QR code public for customers.
  15. Scroll-down to the Registration information section and write down or copy/paste to a document the value from the Original ID field, you will need it for chat bot configuration.

Check again that you have the values of the following fields: Token, EncodingAESKey, Developer ID (AppID), Developer Password (AppSecret)and Original ID.

Step 2: Configure the Druid chat bot

  1. Log in the Druid Chatbot Portal and from the main menu, select your bot. The bot configuration page appears by default on the Details tab.
  2. Click the Channels tab, then click WeChat. The WeChat Channel Info section expands.
  3. Fill in the fields with information from the WeChat official account configuration, as follows:
  4. Druid Field WeChat Official Account Field
    Account Id Original ID
    App Id Developer ID (AppID)
    App Secret Developer Password (AppSecret)
    Token Token
    Encoding AES Key EncodingAESKey
  5. Click the Publish button. The channel activation might take up to 1 minute, wait until it completes.
  6. After the channel's activation, two fields are available in DRUID:

    • [[ChatUser]].ChannelId = "wechat"
    • [[ChatUser]].UserId - Stores the unique identifier of the WeChat user account.
  7. Click the Save & Close button.

Step 3: Make the WeChat QR Code public

After you successfully complete the WeChat integration, you have to make the WeChat QR code available for your customers (either on your website or printed on a paper in the shop). Your customers will open the WeChat app and scan the QR code to chat with your bot.